#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main() {
    int fd = open("/dev/kmsg", O_WRONLY);
    if (fd < 0) {
        perror("Failed to open /dev/kmsg");
        return 1;
    }

    char *message = "<6>xuefeng piao, hello world!\n";
    if (write(fd, message, strlen(message)) < 0) {
        perror("Failed to write to /dev/kmsg");
    }

    close(fd);
    return 0;
}
